package com.blockchain.domain;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import org.apache.commons.lang3.StringUtils;

import junit.framework.Assert;


public class Miner {

	public static List<Block> bills = new ArrayList<Block>();
	
	public static void main(String[] args) {
		
		
		
		
	}
	
	
	public static String getHash(){
		Random r = new Random();
		while(true) {
			int res = r.nextInt(1000);
			if(res >= 900 && res < 1000) {
				return String.valueOf(res);
			}
			
		}
	}
	
	public static Boolean checkDupHash(String newHash) {
		for(Block item : bills) {
			if(StringUtils.equals(item.getHash(), newHash)) {
				return true;
			}
		}
		return false;
	}
	
}
